testmenubutton: Fix inverted keynav in the GtkMenu
authorDaniel Boles <dboles@src.gnome.org>
Sun, 8 Oct 2017 12:15:33 +0000 (13:15 +0100)
committerDaniel Boles <dboles.src@gmail.com>
Sun, 8 Oct 2017 12:17:04 +0000 (13:17 +0100)
commit6cafb62e9b76d0c7c6ff9e0acf03a5f7bc39fac0
tree97203746bb1df2568a612ed6e0a1db9566a46d6c
parent007e4639a8404fba6e71b3e7120de7a34253c2ae
testmenubutton: Fix inverted keynav in the GtkMenu

GtkMenu’s own keynav code, which actually bothers to account for the
layout of items, only happens if columns > 1. So, adding items to 1
column using a reverse loop meant they were placed in the Menu’s list of
children in that order, and because we only have 1 column, Menu passes
keynav up to MenuShell, which doesn’t adjust for the items’ positions.

‘Fix’ that here by adding items in the same order they’ll have when laid
out in the Menu, so keynav does what you’d expect, not the opposite. For
that, it’s simpler just to use gtk_container_add().

Let’s presume users are using add(), attach() with a non-inverted loop,
or attach() with arguments that create 2+ columns and so GtkMenu keynav.
tests/testmenubutton.c